home *** CD-ROM | disk | FTP | other *** search
/ The PC-SIG Library 10 / The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso / PC_SIGCD / 05 / 6 / DISK0564.ZIP / SOURCE.ARC / B.ARC / BIOS.AS < prev    next >
Text File  |  1986-02-23  |  1KB  |  48 lines

  1. ;       general-purpose bios gate
  2. ;       written for Aztec C86 v. 3.20e
  3. ;       by Jon Dart, Feb. 1986
  4.  
  5. MODEL equ 0         ;small code, small data
  6.  
  7. include  lmacros.h
  8.  
  9. ;  bios(interrupt,function,regptr)
  10. ;  /* sets ah=function #, calls bios, returns regs */
  11. ;  int interrupt, function; struct regs *regptr;
  12. ;   /* regptr is a pointer to a struct:
  13. ;   struct regs {
  14. ;       unsigned int ax,bx,cx,dx;
  15. ;   }; */
  16. codeseg segment
  17. procdef bios,<<arg1,word>,<arg2,word>,<arg3,ptr>>
  18.     pushds
  19.     push ds
  20.     mov  ax,cs
  21.     mov  ds,ax      ;temporarily make data seg = code seg
  22.     mov  ax,arg1      ;get 1st arg = interrupt vector
  23.     mov  byte ptr ds:(intins+1),al  ;stick vector into int instruction
  24.     pop  ds              ;restore data seg
  25.         push si
  26.         mov  ax,arg2      ;get 2nd argument = function #
  27.         mov  ah,al        ;function # in ah
  28.         ldptr si,arg3     ;get 3rd argument = pointer to structure.
  29.         mov  al,[si]      ;load al from reg structure
  30.         mov  bx,[si+2]    ;then bx
  31.         mov  cx,[si+4]    ;then cx
  32.         mov  dx,[si+6]    ;then dx
  33. intins:
  34.         int  0            ;call bios
  35.         mov  [si],ax      ;put results into struct
  36.         mov  [si+2],bx
  37.         mov  [si+4],cx
  38.         mov  [si+6],dx
  39.         pop  si
  40.     popds
  41.         pret              ;return to caller
  42.         pend bios
  43.         finish
  44. codeseg ends
  45.         end
  46.  
  47.  
  48.